<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
            var i = 0;
            var timerID = setInterval(function (){
                i++;
                console.log(i);
            if(i == 8){
                clearInterval(timerID);
            }
            },1000);

            var timerID2 = setTimeout(function (){
                console.log("超时调用,只执行一次")

            clearTimeout(timerID2);
            },3000);
            console.log("hello");
            
    </script>
</head>
<body>
    
</body>
</html>